<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
</style>
<script src="../vue.js"></script>

<body>
  <div id="app">
    <div id="app">
      <my-component>
        <template v-slot:header>
          <div>lindaihuang</div>
        </template>
        <template v-slot:content>
          <div>liwentao</div>
        </template>
        <template v-slot:footer>
          <div>lijiateng</div>
        </template>
      </my-component>
    </div>

  </div>

  <script>
    // rander:渲染函数
    Vue.component('my-component', {
      render(createElement) {
        return createElement('div', [
          createElement('header', {
            style: {
              color: "pink",
              fontSize: "80px",
              fontWeight: "400",
              backgroundColor: "#ccc"
            }
          }, this.$slots.header),
          createElement('content', {
            style: {
              color: "pink",
              fontSize: "80px",
              fontWeight: "400",
              backgroundColor: "#ccc"
            }
          }, this.$slots.content),
          createElement('footer', {
            style: {
              color: "pink",
              fontSize: "80px",
              fontWeight: "400",
              backgroundColor: "#ccc"
            }
          }, this.$slots.footer)
        ])
      }
    })


    var vm = new Vue({
      el: "#app"
    })
  </script>
</body>

</html>